{% extends "custom_admin/base.html" %}

{% block title %}管理员登录{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card mt-5">
            <div class="card-header text-center">
                <h3><i class="fas fa-user-lock me-2"></i>管理员登录</h3>
            </div>
            <div class="card-body">
                <form method="post">
                    {% csrf_token %}
                    <div class="mb-3">
                        <label for="{{ form.username.id_for_label }}" class="form-label">用户名</label>
                        {{ form.username }}
                        {% if form.username.errors %}
                        <div class="text-danger">{{ form.username.errors }}</div>
                        {% endif %}
                    </div>
                    <div class="mb-3">
                        <label for="{{ form.password.id_for_label }}" class="form-label">密码</label>
                        {{ form.password }}
                        {% if form.password.errors %}
                        <div class="text-danger">{{ form.password.errors }}</div>
                        {% endif %}
                    </div>
                    {% if form.non_field_errors %}
                    <div class="alert alert-danger">{{ form.non_field_errors }}</div>
                    {% endif %}
                    <div class="d-grid">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-sign-in-alt me-1"></i>登录
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}